-
Notifications
You must be signed in to change notification settings - Fork 121
Add product: Show celebratory view when the first product is created #9790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
You can test the changes from this Pull Request by:
|
selanthiraiyan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works as expected and the confetti looks nice. 🎉
I left a few non-blocking nits/questions.
🚢
WooCommerce/Classes/ViewRelated/Products/Add Product/FirstProductCreatedView.swift
Outdated
Show resolved
Hide resolved
|
|
||
| private extension FirstProductCreatedHostingController { | ||
| enum Localization { | ||
| static let cancel = NSLocalizedString("Cancel", comment: "Button to dismiss the first created product screen") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nit: IMO, "Cancel" might make it challenging to understand whether sharing will be cancelled by tapping this button. (After initiating share) WDYT about using "Close"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the button title to "Dismiss" in 022a58f 👍
| super.init(rootView: FirstProductCreatedView()) | ||
| rootView.onSharingProduct = { [weak self] in | ||
| guard let self else { return } | ||
| SharingHelper.shareURL(url: productURL, from: self.view, in: self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ Is it possible to pass onCompletion block to SharingHelper and dismiss this screen from it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't get a callback when the user submitted any content in the share sheet, so it's not technically possible to handle onCompletion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, OK. I thought we could use theonCompletion parameter. https://github.com/woocommerce/woocommerce-ios/blob/trunk/WooCommerce/Classes/Tools/SharingHelper.swift#L29
Co-authored-by: Sharma Elanthiraiyan <[email protected]>
…m/woocommerce/woocommerce-ios into feat/9785-celebrate-first-product
Generated by 🚫 dangerJS |
This is to match analytics added in iOS: woocommerce/woocommerce-ios#9790
Part of #9785
Description
This PR adds a new view to celebrate when a product is created for the first time. This view contains a button to share the new product too. To make it more fun, the view also has confetti when first presented - this is handled by a new library.
The
AddProductCoordinatorwas updated with a new paramisFirstProduct, used to decide whether to show the celebratory view after a product is successfully created.The coordinator is updated in two places to ensure that we celebrate the first product from store onboarding and the empty view of the Products tab.
Testing instructions
first_created_product_shown.first_created_product_share_tapped.Screenshots
Simulator.Screen.Recording.-.iPhone.14.Pro.-.2023-05-22.at.16.43.26.mp4
RELEASE-NOTES.txtif necessary.